#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main()
{
	int n = 0;
	int min = 1001;
	scanf("%d", &n);
	while (n--)
	{
		int x = 0;
		scanf("%d", &x);
		if (x < min)
		{
			min = x;
		}
	}
	printf("%d", min);
	return 0;
}